<%#= render :partial => 'post', :object => @post %>

<div>
       <h3><%=link_to  @post.title, @post %></h3>
       <p><%=h(@post.body) %></p>
       <p>
          <%= @post.published %>
        </p>
        <p>
          <%= @category.name %>
        </p>
        <p><%= @post.tag_id %><small>
        Comment:<%= @post.comments_count %>
        Views:<%= @post.views_count %>
        Created By: <%= @user.name %>
       <%#= link_to '编辑文章', edit_post_path(@post) %>
       <%#= link_to '删除文章', @post, :confirm => 'Are you sure?', :method => :delete %>
       </small>
       </p>
</div>

<h3> 回复列表 </h3>
<% for comment in @post.comments %>
    <%= comment.body %>
    <%= comment.user_id %>
    <%= link_to '删除回复', post_comment_path(@post, comment), :confirm => 'Are you sure?', :method => :delete %>
    <hr />
<% end %>

<% if @post.close_comment == 0 %>
	<h3>新回复</h3>
	<%= render :partial =>  @comment = Comment.new, :locals => {:button_name => '确定'}  %>
<% end %>

<%= link_to '编辑文章', edit_post_path(@post) %> |
<%= link_to '回到文章列表', posts_path %>

